package net.sxnic.ugr.role.action;

import net.sxnic.comm.log.Log;
import net.sxnic.ugr.UgrActionSupport;
import net.sxnic.ugr.context.AppContext;
import net.sxnic.ugr.role.Role;

/**
 * @version $Revision$
 * @author 张国业
 */
@SuppressWarnings("serial")
public class Delete extends RoleAction {
	

	public String execute() throws Exception {

		try {
			checkRoles(Role.SYSTEM_ADMIN);

			roleManager.deleteById(id);

			// 保存删除成功的信息
			msg = "deleteSuccess";

			// 日志
			addLog(Log.LOG_OPERATION_DLETE, AppContext.getUserName(request)
					+ " delete role sucess! role id:" + id);

		} catch (Exception e) {
			e.printStackTrace();
		}

		return SUCCESS;
	}

}
